import { getDeptTree } from "@/service/api/dept";

export default {
    namespaced: true,
    state: () => ({
        // 部门列表
        deptTree: []
    }),
    mutations: {
        setDeptTree(state, deptTree) {
            state.deptTree = deptTree
        }
    },
    actions: {
        async getDeptTree() {
            const deptTree = await getDeptTree();
            this.commit('deptManagement/setDeptTree', deptTree);
        }
    },
}